package com.vhall.component.controller.tag;

import com.vhall.component.controller.tag.facade.TagConsoleFacade;
import com.vhall.component.entity.tag.TagEntity;
import com.vhall.component.entity.tag.vo.*;
import com.vhall.component.framework.common.annotation.VhallComponent;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import com.vhall.component.service.tag.TagService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author guoxin.wang
 * @date 2021/7/5 10:35
 */
@VhallComponent
public class TagConsoleController implements TagConsoleFacade {

    @Autowired
    private TagService tagService;

    @Override
    @TokenAuth
    public TagEntity save(TagCreateVO reqVO) {
        return tagService.save(reqVO);
    }

    @Override
    @TokenAuth
    public TagPage<TagEntityVO> list(TagListVO reqVO) {
        return tagService.list(reqVO);
    }

    @TokenAuth
    @Override
    public Integer update(TagUpdateVO reqVO) {
        return tagService.update(reqVO);
    }

    @Override
    @TokenAuth
    public Integer delete(TagDeleteVO reqVO) {
        return tagService.delete(reqVO);
    }

    @Override
    public List<TagEntity> info(TagInfoVO reqVO) {
        return tagService.getInfo(reqVO);
    }

    @Override
    @TokenAuth
    public Boolean order(TagOrderVO reqVO) {
        return tagService.rank(reqVO);
    }

    @Override
    @TokenAuth
    public Integer labelDelete(TagDeleteVO reqVO) {
        return tagService.delete(reqVO);
    }

    @Override
    @TokenAuth
    public Boolean count(TagCountVO reqVO) {
        return tagService.count(reqVO);
    }

    @Override
    public Boolean enableTag(EnableTagRequestVO vo) {
        return tagService.enableTag(vo);
    }

}
